import threading
import time
from queue import Queue
def get_detail_html(q):
    while True:
        item = q.get()
        print("get_detail_html start id:{}".format(item))
        time.sleep(1)
        print("get_detail_html end id:{}".format(item))

def get_detail_url(q):
    while True:
        print("get_detail_url start")
        time.sleep(4)
        for i in range(20):
            q.put(i)

        print("get_detail_url end")


if __name__ == '__main__':
    q = Queue(maxsize=10)
    t1=threading.Thread(target=get_detail_url, args=(q,))
    for i in range(10):
        t2=threading.Thread(target=get_detail_html, args=(q,))
        t1.start()

    t2.start()